﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterSite.Master" AutoEventWireup="true" CodeBehind="Booking.aspx.cs" Inherits="WebGui.User.Booking" %>
<%@ Register TagPrefix="DayPilot" Namespace="DayPilot.Web.Ui" Assembly="DayPilot, Version=7.1.2730.1, Culture=neutral, PublicKeyToken=426941954f05e7fe" %>
<%@ Register assembly="DayPilot" namespace="DayPilot.Web.Ui" tagprefix="DayPilot" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="../js/modal.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="HeadLine" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Content" runat="server">
        <script type="text/javascript">
            /* Event editing helpers - modal dialog */
            function dialog() {
                var modal = new DayPilot.Modal();
                modal.top = 60;
                modal.width = 300;
                modal.opacity = 70;
                modal.border = "10px solid #d0d0d0";
                modal.closed = function () {
                    if (this.result == "OK") {
                        dpc.commandCallBack('refresh');
                    }
                    dpc.clearSelection();
                };

                modal.height = 250;
                modal.zIndex = 100;
                return modal;
            }

            function create(start, end) {
                var modal = dialog();
                modal.showUrl("New.aspx?start=" + start.toStringSortable() + "&end=" + end.toStringSortable());
            }

            function edit(e) {
                var modal = dialog();
                modal.showUrl("Edit.aspx?id=" + e.value());
            }

            function open(e) {
                var modal = dialog();
                modal.showUrl("Open.aspx?id=" + e.value());
            }

        
     
    </script>
        <br />
        <br />
    <br />
    
     <DayPilot:DayPilotNavigator ID="CalNavigator" runat="server" BoundDayPilotClientObjectName="dpc"
        SelectMode="Week" CssClassPrefix="navigator_" DataStartField="starttime"
        DataEndField="endtime" VisibleRangeChangedHandling="CallBack" OnVisibleRangeChanged="CalNavigator_VisibleRangeChanged"
        ShowWeekNumbers="True" WeekStarts="Monday" ></DayPilot:DayPilotNavigator>
        <asp:DropDownList ID="DdlUser" runat="server" AutoPostBack="True" 
            onselectedindexchanged="DdlUser_SelectedIndexChanged">
        </asp:DropDownList>
        <br />
    <DayPilot:DayPilotCalendar 
    ID="CalBookings" runat="server" DataStartField="starttime"
    DataEndField="endtime" 
    DataTextField="lessontype" 
    DataValueField="id" 
    OnEventMove="CalBookings_EventMove"
    Days="7"
    OnTimeRangeSelectedJavaScript="" 
    TimeRangeSelectedHandling="CallBack"
    EventMoveHandling="CallBack" 
    EventMoveJavaScript=""
    ContextMenuID="DayPilotMenu" 
    OnEventMenuClick="CalBookings_EventMenuClick" 
    EventResizeHandling="CallBack"
    OnEventResize="CalBookings_EventResize" 
    EventClickHandling="JavaScript" 
    EventClickJavaScript="edit(e);"
    EventSelectHandling="JavaScript" 
    ClientObjectName="dpc" 
    EventEditHandling="CallBack"
    EventDeleteHandling="JavaScript"
    OnEventDelete="CalBookings_EventDelete" 
    EventDeleteJavaScript="if (confirm('Do you really want to delete ' + e.text() + ' ?')) dpc.eventDeleteCallBack(e);"
    OnEventSelect="CalBookings_EventSelect" 
    OnRefresh="CalBookings_Refresh" 
    EventSelectColor="Blue"
    xShowalldayevents="True" 
    UseEventBoxes="Always" 
    AfterRenderJavaScript="afterRender(data);" 
    ShowToolTip="true" 
    EventDoubleClickHandling="Edit"
    EventDoubleClickJavaScript="ask(e);" 
    EventHoverHandling="Bubble" 
    TimeFormat="Auto"
    EventCorners="Rounded"
    DurationBarWidth="10"
        ContextMenuSelectionID="MenuSelection" OnCommand="CalBookings_Command" 
        CssClassPrefix="calendar_" HourNameBackColor="" BorderColor="#A0A0A0" CellBorderColor="#A0A0A0"
        EventBorderColor="#505050" AllDayEventBorderColor="#a0a0a0" RecurrentEventImage="../Media/recur10x9.png"
        RecurrentEventExceptionImage="../Media/recurex10x9.png" Direction="Auto" EventArrangement="Full"
        Style="top: 0px; left: 0px; width: 41%; height: 431px" CellDuration="5" 
        CellHeight="15" HourWidth="40" 
            onbeforecellrender="CalBookings_BeforeCellRender" 
            onbeforeeventrender="CalBookings_BeforeEventRender">
    </DayPilot:DayPilotCalendar>
    <br />
    <DayPilot:DayPilotMenu ID="DayPilotMenu" runat="server">
        <DayPilot:MenuItem Text="Open" Action="JavaScript" JavaScript="open(e);">
        </DayPilot:MenuItem>
        <DayPilot:MenuItem Text="Edit" Action="JavaScript" JavaScript="edit(e)"></DayPilot:MenuItem>
        <DayPilot:MenuItem Text="-------" Action="NavigateUrl"></DayPilot:MenuItem>
        <DayPilot:MenuItem Text="Delete" Action="Callback" Command="Delete"></DayPilot:MenuItem>
    </DayPilot:DayPilotMenu>
    <DayPilot:DayPilotMenu ID="MenuSelection" runat="server">
        <DayPilot:MenuItem Action="JavaScript" JavaScript="create(e.start, e.end);"
            Text="Lav ny Booking" />
        <DayPilot:MenuItem Text="-"></DayPilot:MenuItem>
        <DayPilot:MenuItem Action="JavaScript" JavaScript="alert('Start: ' + e.start.toString() + '\nEnd: ' + e.end.toString());"
            Text="Valgt tidsrum" />
    </DayPilot:DayPilotMenu>
    <DayPilot:DayPilotBubble ID="DayPilotBubble" runat="server" OnRenderContent="DayPilotBubble_RenderContent"
        ClientObjectName="bubble" ShowLoadingLabel="true" HideAfter="500">
    </DayPilot:DayPilotBubble>
    <br />
    <br />
    

</asp:Content>
